{%extends "base.html" %}

{% block mainbody %}



       <table  class="table" id="myTable">
      <thead>
        <tr>
          <th>id</th>
          <th>标题</th>
          <th>摘要</th>
                    <th>内容</th>
                                                            <th>栏目</th>

                                        <th>状态</th>

                    <th>发布时间</th>
                    <th>更新时间</th>
                    <th>操作</th>

        </tr>
      </thead>
      <tbody>
       

      {% for a in Article %}
 <tr>
          <td>{{ a.id }}</td>
                   <td>{{ a.title }}</td>
          <td>{{ a.excerpt }}</td>

          <td>{{ a.content }}</td>
          <td>{{ a.Class }}</td>
            {% if a.status  == 'd' %}
            
                      <td>草稿</td>

            {% else %}
            
                      <td>发表</td>

            {% endif %}
          <td>{{ a.created_time }}</td>
          <td>{{ a.modified_time }}</td>

          <td><p><a href="{% url 'upArticle' %}?id={{ a.id }}">修改</a></p><p><a href="{% url 'delArticle' %}?id={{ a.id }}">删除</a></p></td>

        </tr>
      {% endfor %}
      </tbody>
    </table>
<script>
$(document).ready( function () {
    $('#myTable').DataTable();
} );
</script>
{% endblock %}
